# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-opytimizer
_pkgorig=opytimizer
pkgver=3.1.3
pkgrel=1
pkgdesc="A Python library consisting of nature-inspired meta-heuristic optimization algorithms"
url="https://github.com/gugarosa/opytimizer"
arch="noarch"
license="Apache-2.0"
depends="
	python3
	py3-dill
	py3-matplotlib
	py3-networkx
	py3-numpy
	py3-opytimark
	py3-tqdm
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest-xdist xvfb-run"
subpackages="$pkgname-pyc"
source="https://github.com/gugarosa/opytimizer/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	xvfb-run -a python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -k 'not plot and not test_opytimizer_load'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
fe544066fa977f075f6e05e51df187905d2fc8d4b04e1a1b83e895d87fa1f4c419cb47d2ec75711122c4100a3200fe5efbd26f595cb2ebdf1c2f7ede815fdd34  opytimizer-3.1.3.tar.gz
"
